import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'path' // 主要用于alias文件路径别名
import { visualizer } from 'rollup-plugin-visualizer';
import viteCompression from 'vite-plugin-compression';

// https://vitejs.dev/config/
console.log(process.env.NODE_ENV);
export default defineConfig({
  plugins: [vue(), viteCompression(), visualizer()],
  resolve: {
    //省略后缀
    extensions: ['.js', '.vue', '.json'],
    alias: {
      '@': resolve(__dirname, './src'),
    }
  },
  base: process.env.NODE_ENV == 'development' ? './' : '.',
  build: {
    sourcemap: false,
  }
})
